<!doctype html>
<html>
<head>
<title>blog@admin|WonTube</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<#include "/admin/include/css.html">
</head>
<body>
<div id="page">
	<#include "/admin/include/header.ftl">
	<div class="admin_content">  								
		<table>
			<tr>
				<td>状态:</td>
				<td><select name="status" id="status">		
					<option value="1">已发布</option>			
					<option value="-1">全部</option>
					<option value="0">草稿</option>								
					<option value="2">已删除</option>
				</select></td>	
				<td>分类:</td>
				<td><select id="blogCategory">
					<option value="">All</option>
					<#if categories??>
						<#list categories as cate>
							<#assign name = cate.categoryName>
							<option value="${name}">${name}</option>
						</#list>
					</#if>
				</select></td>
				<td><a href="${contextPath}/admin/blog/new" style="color:green">Add New Blog</a></td>			
			</tr>			
		</table>
		<br />
		<div id="blog_list_div"></div>
		
		<br />
		<div style="float: left;">
			<p>Blog分类列表: </p>
			<table id="category_table">
				<tr><th>排序</th><th>分类名称</th><th>操作</th></tr>
				<#if categories??>
					<#list categories as cat>
						<tr><td>${cat.sortIndex}</td><td>${cat.categoryName}</td>
						<td><a href="javascript:;" class="delete" cid="${cat.id}">删除</a></td>
						</tr>
					</#list>
				</#if>
			</table>
			<br />
			<form id="add_cat_form">
			<table>
				<tr><td>排序:</td><td><input type="text" name="sortIndex" value="0" style="width: 150px" /></td></tr>
				<tr><td>分类名:</td><td><input type="text" name="categoryName"  style="width: 150px" /></td></tr>
				<tr><td colspan="2"><input type="button" id="add_category_btn" value="增加blog分类" /></td></tr>		
			</table>
			</form>
		</div>
		
		<div style="float:left;border-left: 1px solid blue;padding: 10px; margin-left: 10px">
			<p>Blog tags : </p>
			<table id="tag_table">
				<tr><th>排序</th><th>tag名称</th><th>操作</th></tr>
				<#if tags??>
					<#list tags as tag>
						<tr><td>${tag.sortIndex}</td><td>${tag.tagName}</td>
						<td><a href="javascript:;" class="delete" cid="${tag.id}">删除</a></td>
						</tr>
					</#list>
				</#if>
			</table>
			<br />
			<form id="add_tag_form">
			<table>
				<tr><td>排序: </td><td><input type="text" name="sortIndex" value="0" style="width: 150px" /></td></tr>
				<tr><td>tag名称: </td><td><input type="text" name="tagName"  style="width: 150px" /></td></tr>
				<tr><td colspan="2"><input type="button" id="add_tag_btn" value="增加blog tag" /></td></tr>		
			</table>
			</form>
		</div>
    </div> 
    
    <div class="clear-float"></div>
	 <#include "/admin/include/footer.ftl">
</div>
</body>
<#include "/admin/include/js.html">
<script type="text/javascript" src="${jsRoot}/admin/blog/blog_index.js"></script>
</html>